#!/bin/env python


import os
import ConfigParser

def readConfig(config_file):
    '''return value is: {sec_name:[(key:value),(key:value)]'''
    data_dict = {}                                                     
    if not os.path.exists(config_file):                                
        print >>sys.stderr,"%s not exist!"%config_file                 
        os._exit(-1)
    cf = ConfigParser.ConfigParser()                                   
    cf.read(config_file)
    for sec in cf.sections():
        data_dict[sec]=cf.items(sec)                                   
    return data_dict
